// https://v3.nuxtjs.org/docs/directory-structure/nuxt.config
export default defineNuxtConfig({
  // 运行时变量
  runtimeConfig: {
    public: {
      LEAN_APPID: process.env.LEAN_APPID,
      LEAN_APP_KEY: process.env.LEAN_APP_KEY,
      LEAN_SERVER_URL: process.env.LEAN_SERVER_URL
    }
  },
  app: {
    // head
    head: {
      title: 'Element Plus + Nuxt 3',
      meta: [
        { name: 'viewport', content: 'width=device-width, initial-scale=1' },
        {
          hid: 'description',
          name: 'description',
          content: 'ElementPlus + Nuxt3'
        },
        { name: 'keywords', content: 'nuxt3,vue,ts,typescript,博客' }
      ],
      link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
    }
  },
  // css
  css: ['~/assets/style/index.scss'],
  modules: ['@element-plus/nuxt', '@nuxtjs/tailwindcss'],
  elementPlus: {
    importStyle: 'scss'
  },
  vite: {
    css: {
      preprocessorOptions: {
        // 配置 element 主题色
        scss: {
          additionalData: `@use "@/assets/style/element/index.scss" as element;`
        }
      }
    }
  },
  postcss: {
    plugins: {
      tailwindcss: {},
      autoprefixer: {}
    }
  }
})
